#pragma once

#include "SkinWndBase.h"
#include <IXMsgListenSrv.h>

class XWindowBase : public CSkinWndBase
{
    typedef CSkinWndBase superclass;
public:
    XWindowBase();

    virtual void  WINAPI  OnWindowDraw(HDC hDC, LPRECT prc) = 0;

protected:
    // CSkinWndBase
    virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
    virtual void    PreSubclassWnd(HWND hWnd);

    void        DestroyWindow(BOOL bForce);

    void        SetHitTestCode(DWORD dwCode);
    DWORD       GetHitTestCode();

protected:
    // Windows message handlers
    LRESULT     OnPaint(WPARAM wParam, LPARAM lParam);
    LRESULT     OnPrint(WPARAM wParam, LPARAM lParam);
    LRESULT     OnNcPaint(WPARAM wParam, LPARAM lParam);
    LRESULT     OnNcActivate(WPARAM wParam, LPARAM lParam);
    LRESULT     OnNcCalcSize(WPARAM wParam, LPARAM lParam);
    LRESULT     OnNcHitTest(WPARAM wParam, LPARAM lParam);
    LRESULT     OnSetCursor(WPARAM wParam, LPARAM lParam);

private:
    DWORD       m_dwHitTestCode;
    XInstPtr<IXMsgListenSrv> m_pMsgListenSrv;
};
